import { httpPost } from "../utils/http";

const apiUrl = "ylkb";

/**
 * 养老看板_资金计划执行情况
 * @param {*} param
 * @returns
 */
export function zjjhzxqk(param) {
  return httpPost(`${apiUrl}/zjjhzxqk`, param)
    .then((r) => r?.[0]?.data)
    .then((t) => t.records?.[0]);
}

/**
 * 养老看板_应收情况
 * @param {*} param
 * @returns
 */
export function ysqk(param) {
  return httpPost(`${apiUrl}/ysqk`, param)
    .then((r) => r?.[0]?.data)
    .then((t) => t.records?.[0]);
}

/**
 * 养老看板_核销收入情况
 * @param {*} param
 * @returns
 */
export function hxsrqk(param) {
  return httpPost(`${apiUrl}/hxsrqk`, param)
    .then((r) => r?.[0]?.data)
    .then((t) => t.records?.[0]);
}

/**
 * 养老看板_养老总览
 * @param {*} param
 * @returns
 */
export function ylzl(param) {
  return httpPost(`${apiUrl}/ylzl`, param)
    .then((r) => r?.[0]?.data)
    .then((t) => t.records?.[0]);
}

/**
 * 养老看板_应收核销对比情况
 * @param {*} param
 * @returns
 */
export function yshxdbqk(param) {
  return httpPost(`${apiUrl}/yshxdbqk`, param)
    .then((r) => r?.[0]?.data)
    .then((t) => t.records?.[0]);
}

/**
 * 养老看板_欠费情况
 * @param {*} param
 * @returns
 */
export function qfqk(param) {
  return httpPost(`${apiUrl}/qfqk`, param)
    .then((r) => r?.[0]?.data)
    .then((t) => t.records);
}

/**
 * 养老看板_入院情况
 * @param {*} param
 * @returns
 */
export function ryqk(param) {
  return httpPost(`${apiUrl}/ryqk`, param)
    .then((r) => r?.[0]?.data)
    .then((t) => t.records?.[0]);
}

/**
 * 养老看板_食堂客流量
 * @param {*} param
 * @returns
 */
export function stkll(param, t) {
  if (t) {
    return httpPost(`${apiUrl}/stkll`, param)
      .then((r) => r?.[0]?.data)
      .then((t) => t.records?.[0]);
  }
  return httpPost(`${apiUrl}/stkll`, param)
    .then((r) => r?.[0]?.data)
    .then((t) => t.records);
}

/**
 * 养老看板_食堂销售情况
 * @param {*} param
 * @returns
 */
export function stxsqk(param={}) {
    return httpPost(`${apiUrl}/stxsqk`, param)
      .then((r) => r?.[0]?.data)
      .then((t) => t.records);
}

/**
 * 养老看板_养老分布图
 * @param {*} param
 * @returns
 */
export function ylfbt(param={}) {
    return httpPost(`${apiUrl}/ylfbt`, param)
      .then((r) => r?.[0]?.data)
      .then((t) => t.records);
}
